package me.zixing.java.chapter07.task01;

public class Task01 {
	public static void main(String[] args) {
		String s = "asdf asd";
		int lastIndex = 0;
		int count = 0;
		while((lastIndex = s.indexOf("asd",lastIndex)) != -1){
			count ++;
			System.out.println("出现位置:"+lastIndex++);
		}
		System.out.println("出现次数:"+count);
	}
	
	
}
